AUTOMAKE_OPTIONS = foreign subdir-objects
# Don't loose the autoconf include path
ACLOCAL_AMFLAGS = -I config

# Automake doesn't seem to have a directory defined for
# platform-dependent data (or include) files. So put 
# in $(libdir).  Define a $(cfgdir) to get around automake's
# check that only libraries are going in $(libdir)
cfgdir = $(libdir)
cfg_DATA = cgm.make

if ENABLE_igeom
  igeom_DIR = itaps
else
  igeom_DIR = 
endif 

SUBDIRS =  src compat . $(igeom_DIR) test tools

EXTRA_DIST = config/CGMConfig.cmake.cmake \
						 config/CGMConfig.cmake.h.in \
						 config/CGMMacros.cmake \
						 config/CheckCompilerFlags.cmake \
						 config/FindOpenCasCade.cmake \
						 config/ForceAddFlags.cmake \
						 config/ResolveCompilerPaths.cmake \
						 config/GetAcInitVersion.cmake \
						 config/CGMConfigure.h.in config/CGMGeomConfigure.h.in \
						 config/CGMIGeomConfigure.h.in config/CGMInitConfigure.h.in \
						 config/CGMUtilConfigure.h.in config/cmake_uninstall.cmake.in \
						 CMakeLists.txt

cmakedir=$(libdir)/cmake/CGM
cmake_DATA=CGMConfig.cmake config/ResolveCompilerPaths.cmake

# By default, cmg.make will define these to $(srcdir).  We
# want to override that during the INSTALL of the file so
# that the correct values are set (e.g. if someone does 
# 'make prefix=/foo install', we don't know the correct install
# directory until we're doing the install.
CFG_FILE = $(DESTDIR)$(cfgdir)/cgm.make
install-data-hook:
	$(AM_V_at)echo "CGM_INT_INCLUDE = -I$(includedir)/cgm"  >> $(CFG_FILE)
	$(AM_V_at)echo "CGM_INT_LDFLAGS = -L$(libdir)"      >> $(CFG_FILE)
	$(AM_V_at)echo "CGM_INT_LTFLAGS = -R$(libdir)"      >> $(CFG_FILE)

CLEANFILES = configs.sed
DISTCLEANFILES = ./itaps/CgmaIGeomConfigure.h
